<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>Adicionar Registro</h2>
    </div>
    <!-- End Box Head -->

    <?php
    if (isset($_SESSION['obj'])) {
        $obj = unserialize($_SESSION['obj']);
        $id = $obj->id;
        $descricao = $obj->descricao;
        $ativo = $obj->ativo;
        $op = 'A';
    } else {
        $id = '';
        $descricao = '';
        $ativo = '';
        $op = 'I';
    }
    ?>


    <form action="../controller/Controller.php" method="post">

        <!-- Form -->
        <div class="form">
            <p>
                <label>Descrição: </label>
                <input type="text" class="field size1" name='descricao' value="<?php echo $descricao ?>" />
            </p>	
            <p>
                <label>Ativo: </label>
                <input type="checkbox" class="field size1" name='ativo' value="S"  <?php if($ativo=='S') echo 'checked'; ?> />
            </p>
            <input type="hidden" name='op' value="<?php echo $op ?>" />
            <input type="hidden" name='id' value="<?php echo $id ?>" />
        </div>
        <!-- End Form -->



        <!-- Form Buttons -->
        <div class="buttons">
            <input type="reset" class="button" value="Limpar" />
            <input type="submit" class="button" value="Gravar" />
        </div>
        <!-- End Form Buttons -->
    </form>
</div>
<!-- End Box -->